package com.kuang.fi;

import java.util.function.Supplier;

/**
 * @program: juc
 * @description: 供给型接口
 * @author: 陈恩涛
 * @create: 2021-03-22 16:23
 **/
public class Demo04 {
    public static void main(String[] args) {
        //没有参数，只有返回值
//        Supplier<Integer> supplier = new Supplier<Integer>() {
//            @Override
//            public Integer get() {
//                return 1024;
//            }
//        };

        Supplier<Integer> supplier = () -> {
            System.out.println("get()");
            return 1024;
        };

        System.out.println(supplier.get());
    }
}
